<template>
  <div>
    <van-nav-bar
      title="我的卡劵"
      left-arrow
      @click-left="onClickLeft"
      fixed
    ></van-nav-bar>
    <div class="warn">
      <p>劵到期提醒</p>
      <button class="btn">订阅</button>
    </div>
    <!-- 标签页 -->
    <van-tabs class="tabs" v-model="active" animated>
      <van-tab title="全部">
        <coupons />
      </van-tab>
      <van-tab title="茶饮劵">
        <coupons />
      </van-tab>
      <van-tab title="酒屋劵">
        <no-cards />
      </van-tab>
      <van-tab title="零售劵">
        <no-cards />
      </van-tab>
    </van-tabs>
    <!-- 底部标签栏 -->
    <van-tabbar fixed>
      <van-tabbar-item name="exchange" to="/couponexchange">优惠券兑换</van-tabbar-item>
      <van-tabbar-item name="hiscard" to="/historycard">历史卡劵</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
import Coupons from "../components/Coupons.vue";
import NoCards from "../components/NoCards.vue";
export default {
  components: { Coupons, NoCards },
  data() {
    return {
      active: 0,
    };
  },
  methods: {
    onClickLeft() {
      this.$router.push("index");
    },
  },
};
</script>

<style lang="scss" scoped>
::v-deep .van-icon {
  color: black;
}
::v-deep .van-tabs__line {
  background-color: #a5d403;
}
::v-deep .van-tab--active {
  color: #a5d403;
}
.warn {
  width: 94vw;
  height: 12vw;
  margin: 16vw auto 2vw;
  background-color: #fff;
  box-shadow: 0 0 3px 2px #d3d3d4;
  border-radius: 1vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.warn p {
  display: block;
  margin-left: 3vw;
  font-size: 4vw;
}
.warn .btn {
  color: #fff;
  background-color: #000;
  border: none;
  margin-right: 3vw;
  padding: 5px 3vw;
  font-size: 12px;
}
::v-deep .van-tabs__nav {
  background-color: #f3f4f5;
}
::v-deep .van-tabbar-item {
  position: relative;
}
::v-deep .van-tabbar-item::after {
  content: "|";
  font-size: 6vw;
  color: #e2e5e7;
  display: inline-block;
  position: absolute;
  right: 0;
}
::v-deep .van-tabbar-item:nth-child(2)::after {
  content: "";
}
</style>
